﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace FrbaCommerce.Abm_Rubro
{
    public partial class FormAltaRubro : Form
    {
        


        public FormAltaRubro()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = Program.obtenerConexion();
            SqlCommand altaRubro = new SqlCommand("INSERT INTO [Monkey_Coders].Rubros (rub_descripcion) VALUES (@Descripcion)", con);
            altaRubro.Parameters.Add("Descripcion", SqlDbType.VarChar, 255).Value = textBox1.Text;
            Codigo_reutilizable.Resultado.validar(altaRubro.ExecuteNonQuery(), "Alta de Rubro exitosa");
            textBox1.Clear();

            this.Close();
            
        }

    }
}
